﻿using Autodesk.Revit.UI;
using FloatDemo.Commands;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace FloatDemo.Addin
{
    public class FloatAddin : IExternalApplication
    {
        public Result OnShutdown(UIControlledApplication application)
        {
            return Result.Succeeded;
        }

        public Result OnStartup(UIControlledApplication application)
        {
            application.CreateRibbonTab("浮标测试");
            RibbonPanel panel1 = application.CreateRibbonPanel("浮标测试", "功能");
            PushButtonData pd1 = new PushButtonData("xx1", "开启浮标测试", typeof(FloatAddin).Assembly.Location, typeof(CreatePipesTagCmd).FullName);
            pd1.LargeImage = new BitmapImage(new Uri(Path.GetDirectoryName(typeof(FloatAddin).Assembly.Location) + "\\Images\\浮标.png"));
            PushButton pb1 = panel1.AddItem(pd1) as PushButton;

            return Result.Succeeded;
        }
    }
}
